package validation;

import dbmanager.DBManager;

public class Isdouble implements Validation 
{
	public String getMessage() 
	{
		return "is must be number and may have decimal";
	}

	public void setDbmanager(DBManager database) 
	{
	}

	public boolean validate(String Value) 
	{
		try
		{
			@SuppressWarnings("unused")
			double tempvalue = Double.parseDouble(Value);
			return true;
		}
		catch (NumberFormatException e) 
		{
			return false; 
		}
	}

	public boolean validate(String Value, String ConditionValue) 
	{
		return false;
	}

	public boolean validate(String Value, String ConditionValue, String Refvalue) 
	{
		
		if(ConditionValue.equalsIgnoreCase("true"))
		{
			return validate(Value);
		}
		else if(ConditionValue.equalsIgnoreCase("false"))
			return true;
		else
			return false;
	}

	public void setBasicvalue(String value) {
		// TODO Auto-generated method stub
		
	}
	public static void main(String[] args) 
	{
		Isdouble dob = new Isdouble();
		System.out.println(dob.validate("20t"));
	}
}
